import {getAPI} from "@/api/MyAxiosAPI";

const API = getAPI(false)

export async function getHistoryMessageAPI(token: string, friendId: string, page: number, pageSize: number) {
    const r = await API.get(
        "/IM/message/history/"+friendId+"/"+page+"/"+pageSize,
        {
            headers: {
                "Authorization": token
            },
        })
    return r.data
}

export async function sendSignalMessageAPI(content:string,toUid:string,token:string){
    console.log(content,toUid)
    const r = await API({
        url:"/IM/message/send",
        method:"post",
        headers:{
            Authorization:token
        },
        data:{
            "message":content,
            "toUid":toUid,
            "time": new Date()
        }
    })
    return r.data
}